﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LardonPokerSimulator.Model
{
    public class Table
    {
        internal static readonly int MAX_PLAYERS = 9;
        internal static readonly int START_TOKENS_NUMBERS = 25000;
        internal static readonly String NAME_PLAYER_HUMAN = "Rob Douche";
        internal Random random = new Random();
        internal Player[] players = null;

        public Table()
        { }

        public Table(int randomSeed)
        {
            this.random = new Random(randomSeed);
        }

        internal void GeneratePlayers()
        {
            int numberPlayers = this.random.Next(MAX_PLAYERS - 1);
            List<Player> playerList = new List<Player>();

            for (int i = 0; i < numberPlayers; i++)
            {
                String name = String.Format("P{0}", (i + 1));
                playerList.Add(new Player(name, START_TOKENS_NUMBERS));
            }

            Player rob = new Player(Table.NAME_PLAYER_HUMAN, START_TOKENS_NUMBERS);
            playerList.Add(rob);

            this.players = playerList.ToArray();
        }
    }
}
